#include "dialog.h"
#include "ui_dialog.h"
#include <QLabel>
#include <QPixmap>
#include <QApplication>
//#include <QDesktopWidget>

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);

    // 隐藏主任务栏窗口
    setWindowFlags(Qt::FramelessWindowHint | Qt::Tool);//无边框设置
    setAttribute(Qt::WA_TranslucentBackground);//背景透明设置
    setMouseTracking(true);

    // 设置背景图片
    QLabel *image = new QLabel(this);
    QPixmap pixmap(":/png/ui/9.png");
    image->setPixmap(pixmap);
    image->setGeometry(0,0,pixmap.width(),pixmap.height());
    image->lower();

    // 将窗口设置为模态
    setModal(true);
}

Dialog::~Dialog()
{
    delete ui;
}

void Dialog::on_ok_clicked()
{
    this->close();
}
